home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 March / Macworld CD-ROM (March 1995).cdr / Updaters / AppMaker 1.5.2->1.5.4 / Libraries / THINK / AMClassLibC / CAMBorder.cp < prev    next >
Encoding:
Text File  |  1991-11-24  |  1.5 KB  |  53 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CAMBorder.c
  3.  
  4.     Creates a simple pane with a border.
  5.     Functional equivalent of the CBorder class. It replaces CBorder
  6.     so that none of the TCL compatibility classes will be needed.
  7.  
  8.     SUPERCLASS = CPane
  9.  
  10.     Copyright © 1991 Bowers Development Corporation. All rights reserved.
  11.  
  12. ******************************************************************************/
  13.  
  14. #include "CAMBorder.h"
  15. #include <CPaneBorder.h>
  16.  
  17. /******************************************************************************
  18.  IViewTemp (OVERRIDE)
  19.  
  20.         Initialize a Border object using a template
  21. ******************************************************************************/
  22.  
  23. void CAMBorder::IViewTemp             (CView            *anEnclosure,
  24.                                       CBureaucrat    *aSupervisor,
  25.                                       Ptr            viewData)
  26. {
  27.     BorderTempP        p;
  28.     short            thickness;
  29.     short            dropShadow;
  30.     CPaneBorder        *border;
  31.     Rect            margin;
  32.  
  33.     p = (BorderTempP) viewData;
  34.  
  35.     inherited::IViewTemp (anEnclosure, aSupervisor, (Ptr) &p->sPaneTemp);
  36.  
  37.     thickness = p->thickness;
  38.     dropShadow = p->dropShadow;
  39.  
  40.     border = new CPaneBorder;
  41.     border->IPaneBorder (kBorderFrame);
  42.     SetRect (&margin, thickness, thickness, -thickness, -thickness);
  43.             /* A pane border draws outside its pane. We want it */
  44.             /* to draw inside the pane so we inset its margin. */
  45.     border->SetMargin (&margin);
  46.     border->SetPenSize (thickness, thickness);
  47.     border->SetShadow (dropShadow, dropShadow, dropShadow, dropShadow);
  48.     SetBorder (border);
  49.  
  50. } /* IViewTemp */
  51.  
  52. /* CAMButton */
  53.